
layui.use(['form'], function () {
    var form = layui.form,
    $ = layui.jquery;
    $(".baoFormBox").height(window.screen.height-215);
    // 从父级获取列表id
    var id,loading;
    $.each(window.parent.$('.x-iframe'),function(i,v){
        if(v.id!=="postre"&&v.id!="undefined"){
            id=v.id;
        }
    })
    $.ajax({
        url: 'gt/opm/workSheet/'+id, //请求地址
        type: "GET", //提交的方式S
        dataType: "JSON", //返回类型 TEXT字符串 JSON XML
        beforeSend: function() {
            loading=layer.load(2);
        },
        ContentType:"application/json;charset=UTF-8",
        success: function(data) { 
            layer.closeAll('loading');
            var data=data.data;
            if(data.questionType=="业务系统"){
                $(".displayH").append(
                    '<td class="widtdFor">系统名称：</td>'
                    +'<td  class="widtdFdlo" id="systemName">'+data.systemName+'</td>'
                    +'<td class="widtdFor">系统名称：</td>'
                    +'<td  class="widtdFdlo" id="systemAddress">'+data.systemAddress+'</td>'
                )
            }else{
                $(".displayH td").remove();
                $(".displayH td").remove();
            }
            if(data.questionDesc.length<=30){
                $("#DescCbao").append(
                '<td class="widtdFor">问题详述：</td>'
                 +'<td  class="widtdFdlo">'
                 +'<div class="bao_scroll"><p id="questionDesc">'+data.questionDesc+'</p></div>'
                 +'</td> '
                )
             // $("#questionDesc").html(data.questionDesc);
            }else{
             $("#DescSbao").append(
                 '<td class="widtdFor">问题详述：</td>'
                  +'<td class="widtdFdlo" colspan=7>'
                  +'<div class="bao_scroll"><p id="questionDesc">'+data.questionDesc+'</p></div>'
                  +'</td> '
                 )
            }
            $("#workSheetCode").html(data.workSheetCode);
            $("#questionType").html(data.questionType);
            $("#questionContent").html(data.questionContent);
            // $("#questionDesc").html(data.questionDesc);
            $("#createDept").html(data.createDept);
            $("#workSheetContacts").html(data.workSheetContacts);
            $("#workSheetPhone").html(data.workSheetPhone);
            $("#createDate").html(data.createDate);
            $("#statut").html(data.statu);
        }
    })
})

